<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
[#include "/admin/include/head.htm"]
    <script type="text/javascript">
        var grid;


        $(function(){
            grid = $("#maingrid").ligerGrid({
                columns: [
                    {display: 'id', name: 'id', align: 'center', width: 100 },
                    {display: '种类', name: 'category', align: 'center', width: 100,dict:'redpacket_category' },
                    {display: '名称', name: 'name', align: 'center', width: 100 },
                    {display: '是否有效', name: 'is_disable', align: 'center', width: 100 ,render: function(row){
                        return row.is_disable==0?"否":"是";

                    }},


                    {display: '金额', name: 'money', align: 'center', width: 100 },
                    {display: '投资触发额', name: 'tender_limit', align: 'center', width: 100 },
                    {display: '限定投标月份', name: 'tender_time_limit', align: 'center', width: 100 },
                    {display: '删除', align: 'center', width: 100,
                        render: function(row){
                            var html = '<input value="删除" style="cursor:pointer" type="button" onclick="f_del('+row.id+')">';
                            return html;

                        }
                    }

                ],  pageSize:20, url: 'queryData.aspx',toolbar: {}, width: '100%', height:'100%', enabledSort: true
            });

            $(".l-toolbar").ligerToolBar({ items: [
                { text: '改变状态', click: f_open },

                { line:true },

                { text: '添加', click: f_add}

            ]
            });
            //绑定搜索按钮
            LG.search(grid);
        });
        function f_add(){
            top.f_addTab(null, '添加', base+'/admin/redpacketcategory/add.aspx');
        }
        function f_del(id){
            window.location.href  =  base+'/admin/redpacketcategory/delete.aspx?id='+id;
        }
        /**
         * 商品上架
         */
        function f_open() {
            var selecteds = grid.getSelecteds();
            if (selecteds.length > 0) {

                if (confirm){
                    LG.ajax({
                        url: base + '/admin/redpacketcategory/modify.aspx',
                        loading: '正在改变中...',
                        data: { id: selecteds[0].id  },
                        success: function () {
                            LG.showSuccess('操作成功!');
                            f_reload();
                        },
                        error: function (message) {
                            LG.showError(message);
                        }
                    });
                }

            } else {
                LG.tip('请选择行!');
            }
        }


    </script>
</head>
<body style="padding:10px; overflow:hidden;">
<div id="functions">
    <div class="clearfix">

        [#--<div style="float:left;">--]
				[#--<span>--]
					[#--类型： [@u.select listKey="id"  headerKey="" headerValue="全部类型" listValue="category_name" headerButtom="false" list=LoanCategoryUtils.getLoanCategoryList()--]
                [#--name="loanCategory" value="${(loanCategory)!''}" /]--]
				[#--</span>--]
				[#--<span>--]
					[#--用户名：<input type="text" name="memberName"  />--]
				[#--</span>--]

            [#--申请时间：<input type="text" id="begin_date" name="begin_date"--]
                        [#--class="formText WdatePicker {dateFmt:'yyyy-MM-dd'}" />--]
            [#-----]
            [#--<input type="text" id="endDate" name="end_date"--]
                   [#--class="formText WdatePicker {dateFmt:'yyyy-MM-dd'}" />--]
            [#--<input type="button" class="button" value="搜索" id="search"/>--]
            [#--<a href="#" id="search_btn_reset" face="Wingdings 3">清除本次搜索</a>--]
        [#--</div>--]

    </div>
</div>

<div id="maingrid" style="margin:0; padding:0"></div>
</body>
</html>